
<fieldset><legend>采购单</legend>
<form id="form_add">
<table>
	<tr>
		<td width="20%" align="right">名称：</td>
		<td width="30%"><input type="text" name="name" value="委托生产合同" size="20"></td>
		<td width="20%" align="right">交货日期：</td>
		<td width="30%"><input type="text" name="date" id="date" size="10" value="{[$t1|date_format:'%Y-%m-%d']}"></td>
	</tr>
	<tr>
		<td align="right">客户：</td>
		<td colspan="3"><select name='customer' id='customer'>
			{[html_options options=$tecmold_option selected=-]}
		</select> <a href="javascript:void(0)"
			id="customer_x" onclick="Common.toggle(this, '#label_linkman_a')(this)" class="ui-icon ui-icon-circle-triangle-w"
			style="display: inline-table"></a></td>
	</tr>
	<tr id="label_linkman_a">
		<td></td>
		<td colspan="3">{[include file="contact/customer/_linkman.tpl"]}</td>
	</tr>
	<tr>
		<td align="right">采购员：</td>
		<td colspan="3"><input type="text" name="emp" id="emp" size="12" value="{[$smarty.session.id]}:{[$smarty.session.name]}" title="{[$t.emp_|emp:'采购员']}"> <input
			type="checkbox" name="t_emp" id="t_emp" value="{[$smarty.session.id]}:{[$smarty.session.name]}" checked> 自己</td>
	</tr>
	<tr>
		<td align="right">交货地点：</td>
		<td colspan="3"><textarea rows="2" name="address" id="address" cols="55">沙井镇步涌同富裕工业区A-5地块B3栋</textarea> <select name='address_t'
			id='address_t'>
			{[html_options options=$address_option selected=-]}
		</select></td>
	</tr>
	<tr>
		<td align="right">备注：</td>
		<td colspan="3"><textarea rows="2" name="content" id="content" cols="55"></textarea></td>
	</tr>
</table>
</form>
</fieldset>

<fieldset><legend>采购明细</legend>
<form name="purchase_add">
<table>
	<tr align="center">
		<th width="40">序号</th>
		<th>编号</th>
		<th>名称</th>
		<th>规格</th>
		<th>单价</th>
		<th>数量</th>

		<th></th>
	</tr>
	{[foreach name=outer key=key item=item from=$result]} {[assign var="no" value="`$key+$pager->from+1`"]}
	<tr id="row_{[$item.id]}" align="center" onMouseOver="this.style.backgroundColor='#D2E4FC'"
		onMouseOut="this.style.backgroundColor=''">
		<td>{[$no]}</td>
		<td>{[$item.code]}</td>
		<td>{[$item.name]}</td>
		<td>{[$item.standard]}</td>
		<td><input type="text" name="price_{[$item.id]}" id="price_{[$item.id]}" size="8" value="{[$item.price]}"></td>
		<td><a href="javascript:void(0)" onclick="amount_dec({[$item.id]});"><img style='display: inline'
			src='/images/bag_close.gif' border='none' /></a> <input type="text" name="amount_{[$item.id]}" id="amount_{[$item.id]}"
			size="3" value="1"> <a href="javascript:void(0)" onclick="amount_add({[$item.id]});"><img style='display: inline'
			src='/images/bag_open.gif' border='none' /></a></td>

		<td><a href="javascript:void(0)" onclick="cart_del({[$item.id]});"><img style='display: inline'
			src='/images/12-em-cross.png' border='none' /></a></td>
	</tr>
	{[/foreach]}
	<tr>
		<td align="right" colspan="7">
		<div id="total">总金额：{[$total]}</div>
		</td>
	</tr>
</table>
</form>
</fieldset>

<script type="text/javascript" src="js/material/in/purchase/add.js?r={[$smarty.now]}"></script>
